<template>
  <div>

    <avue-crud
        v-if="tableOption"
        v-bind="bindVal"
        v-on="onEvent"
        v-model:page="page"
        v-model="startForm">
    </avue-crud>

  </div>
</template>

<script>
import {createStaticMixin} from "@/mixins/startCrud.js"
import dataRuleOption from "@/option/sys/dataRuleOption";
import * as dataRuleApi from "@/api/sys/dataRuleApi";

const option = {}
option.option = dataRuleOption
option.api = dataRuleApi

export default {
  name: "dataRule",
  mixins: [createStaticMixin(option)],
  data() {
    return {
      drawerVisible: false,
      menuId: null,
    }
  },
  created() {
    this.searchParams.menuId = -10000000;
  },
  methods: {
    show(id) {
      this.menuId = id;
      this.drawerVisible = true;
      this.searchChange({}, null)
    },
    beforeLoadDataSource() {
      this.searchParams.menuId = this.menuId;
    },
    handleClose() {
      this.drawerVisible = false;
      this.menuId = null;
      this.searchParams.menuId = -10000000
    },
    rowSaveBefore(row) {
      row.menuId = this.menuId
    }
  }
}
</script>

<style scoped>

</style>
